<?php
// +----------------------------------------------------------------------
// | 后台应用路由
// +----------------------------------------------------------------------
// | Author: myh
// +----------------------------------------------------------------------
use think\facade\Route;
Route::get('a','index/a');

//获取验证码
Route::get('login/verify','sysUser/verify');
//管理员登录
Route::post('login','sysUser/login');

Route::get('upload','test/upload');


Route::group('user', function(){
    //用户列表
    Route::get('page','user/page');
    //用户详情
    Route::get('info','user/info');
    //用户编辑
    Route::get('edit','user/edit');
    //导出
    Route::get('export','user/export');
    //上传头像
    Route::post('uploadAvatar','user/uploadAvatar');
    

    //用户等级列表
    Route::get('level/list','userLevel/list');
    //用户等级新增
    Route::post('level/add','userLevel/add');
    //用户等级更新
    Route::post('level/edit','userLevel/edit');
    //用户等级删除
    Route::get('level/delete','userLevel/delete');
    //上传等级预览图
    Route::post('level/uploadAvatar','userLevel/uploadAvatar');

    //用户权益列表
    Route::get('privilege/list','userPrivilege/list');
    //用户权益新增
    Route::post('privilege/add','userPrivilege/add');
    //用户权益更新
    Route::post('privilege/edit','userPrivilege/edit');
    //用户权益删除
    Route::get('privilege/delete','userPrivilege/delete');
    //上传权益预览图
    Route::post('privilege/uploadAvatar','userPrivilege/uploadAvatar');
})->middleware(app\admin\middleware\Auth::class);


Route::group('sysuser', function(){
    //新增管理员
    Route::post('add','sysUser/add');
    //编辑管理员
    Route::post('edit','sysUser/edit');
    //管理员列表
    Route::get('page','sysUser/page');
    //启用、禁用
    Route::post('updateStatus','sysUser/updateStatus');
    //删除
    Route::get('delete','sysUser/delete');
    //修改个人密码
    Route::post('updatePwd','sysUser/updatePwd');
    //登录用户信息
    Route::get('loginUserInfo','sysUser/loginUserInfo');

    //新增角色
    Route::post('role/add','sysRole/add');
    //编辑角色
    Route::post('role/edit','sysRole/edit');
    //角色列表
    Route::get('role/page','sysRole/page');
    //角色列表
    Route::get('role/list','sysRole/list');
    //删除角色
    Route::get('role/delete','sysRole/delete');
    //授权
    Route::get('role/hasAuth','sysRole/hasAuth');

    //新增菜单
    Route::post('menu/add','sysMenu/add');
    //编辑菜单
    Route::post('menu/edit','sysMenu/edit');
    //菜单列表
    Route::get('menu/list','sysMenu/list');
    //删除菜单
    Route::get('menu/delete','sysMenu/delete');
})->middleware(app\admin\middleware\Auth::class);

Route::group('goods', function(){
    //品牌列表
    Route::get('brand/page','GoodsBrand/page');
    //品牌新增
    Route::post('brand/add','GoodsBrand/add');
    //品牌更新
    Route::post('brand/edit','GoodsBrand/edit');
    //更新品牌状态
    Route::post('brand/changeStatus','GoodsBrand/edit');
    //品牌删除
    Route::get('brand/delete','GoodsBrand/delete');
    //上传品牌LOGO
    Route::post('brand/upload','GoodsBrand/uploadLogo');

    //分类列表
    Route::get('category/list','GoodsCategory/list');
    //分类新增
    Route::post('category/add','GoodsCategory/add');
    //分类更新
    Route::post('category/edit','GoodsCategory/edit');
    //分类删除
    Route::get('category/delete','GoodsCategory/delete');
    //上传分类图片
    Route::post('category/upload','GoodsCategory/upload');

    //规格列表
    Route::get('spec/page','GoodsSpec/page');
    //规格新增
    Route::post('spec/add','GoodsSpec/add');
    //规格更新
    Route::post('spec/edit','GoodsSpec/edit');
    //规格删除
    Route::get('spec/delete','GoodsSpec/delete');

    //规格属性列表
    Route::get('spec/value/list','GoodsSpecValue/list');
    //规格属性新增
    Route::post('spec/value/add','GoodsSpecValue/add');
    //规格属性更新
    Route::post('spec/value/edit','GoodsSpecValue/edit');
    //规格属性删除
    Route::get('spec/value/delete','GoodsSpecValue/delete');

})->middleware(app\admin\middleware\Auth::class);

    

